package c.e.a.c.t;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.ContextThemeWrapper;
import java.util.Objects;

/* compiled from: ShapeAppearanceModel */
public class j {
    public static final c m = new h(0.5f);
    public d a;
    public d b;
    public d c;
    public d d;
    public c e;
    public c f;
    public c g;
    public c h;
    public f i;
    public f j;
    public f k;
    public f l;

    /* compiled from: ShapeAppearanceModel */
    public static final class b {
        public d a = new i();
        public d b = new i();
        public d c = new i();
        public d d = new i();
        public c e = new a(0.0f);
        public c f = new a(0.0f);
        public c g = new a(0.0f);
        public c h = new a(0.0f);
        public f i = new f();
        public f j = new f();
        public f k = new f();
        public f l = new f();

        public static float b(d dVar) {
            if (dVar instanceof i) {
                Objects.requireNonNull((i) dVar);
                return -1.0f;
            }
            if (dVar instanceof e) {
                Objects.requireNonNull((e) dVar);
            }
            return -1.0f;
        }

        public j a() {
            return new j(this, null);
        }

        public b c(float f) {
            this.h = new a(f);
            return this;
        }

        public b d(float f) {
            this.g = new a(f);
            return this;
        }

        public b e(float f) {
            this.e = new a(f);
            return this;
        }

        public b f(float f) {
            this.f = new a(f);
            return this;
        }

        public b(j jVar) {
            this.a = jVar.a;
            this.b = jVar.b;
            this.c = jVar.c;
            this.d = jVar.d;
            this.e = jVar.e;
            this.f = jVar.f;
            this.g = jVar.g;
            this.h = jVar.h;
            this.i = jVar.i;
            this.j = jVar.j;
            this.k = jVar.k;
            this.l = jVar.l;
        }
    }

    public j(b bVar, a aVar) {
        this.a = bVar.a;
        this.b = bVar.b;
        this.c = bVar.c;
        this.d = bVar.d;
        this.e = bVar.e;
        this.f = bVar.f;
        this.g = bVar.g;
        this.h = bVar.h;
        this.i = bVar.i;
        this.j = bVar.j;
        this.k = bVar.k;
        this.l = bVar.l;
    }

    public static b a(Context context, int i, int i2, c cVar) {
        if (i2 != 0) {
            Context contextThemeWrapper = new ContextThemeWrapper(context, i);
            i = i2;
            context = contextThemeWrapper;
        }
        TypedArray obtainStyledAttributes = context.obtainStyledAttributes(i, c.e.a.c.b.v);
        try {
            i = obtainStyledAttributes.getInt(0, 0);
            i2 = obtainStyledAttributes.getInt(3, i);
            int i3 = obtainStyledAttributes.getInt(4, i);
            int i4 = obtainStyledAttributes.getInt(2, i);
            i = obtainStyledAttributes.getInt(1, i);
            cVar = c(obtainStyledAttributes, 5, cVar);
            c c = c(obtainStyledAttributes, 8, cVar);
            c c2 = c(obtainStyledAttributes, 9, cVar);
            c c3 = c(obtainStyledAttributes, 7, cVar);
            cVar = c(obtainStyledAttributes, 6, cVar);
            b bVar = new b();
            d d = c.e.a.c.a.d(i2);
            bVar.a = d;
            b.b(d);
            bVar.e = c;
            d = c.e.a.c.a.d(i3);
            bVar.b = d;
            b.b(d);
            bVar.f = c2;
            d = c.e.a.c.a.d(i4);
            bVar.c = d;
            b.b(d);
            bVar.g = c3;
            d d2 = c.e.a.c.a.d(i);
            bVar.d = d2;
            b.b(d2);
            bVar.h = cVar;
            return bVar;
        } finally {
            obtainStyledAttributes.recycle();
        }
    }

    public static b b(Context context, AttributeSet attributeSet, int i, int i2, c cVar) {
        TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, c.e.a.c.b.r, i, i2);
        i2 = obtainStyledAttributes.getResourceId(0, 0);
        i = obtainStyledAttributes.getResourceId(1, 0);
        obtainStyledAttributes.recycle();
        return a(context, i2, i, cVar);
    }

    public static c c(TypedArray typedArray, int i, c cVar) {
        TypedValue peekValue = typedArray.peekValue(i);
        if (peekValue == null) {
            return cVar;
        }
        int i2 = peekValue.type;
        if (i2 == 5) {
            return new a((float) TypedValue.complexToDimensionPixelSize(peekValue.data, typedArray.getResources().getDisplayMetrics()));
        }
        return i2 == 6 ? new h(peekValue.getFraction(1.0f, 1.0f)) : cVar;
    }

    public boolean d(RectF rectF) {
        Class cls = f.class;
        Object obj = (this.l.getClass().equals(cls) && this.j.getClass().equals(cls) && this.i.getClass().equals(cls) && this.k.getClass().equals(cls)) ? 1 : null;
        float a = this.e.a(rectF);
        Object obj2 = (this.f.a(rectF) == a && this.h.a(rectF) == a && this.g.a(rectF) == a) ? 1 : null;
        Object obj3 = ((this.b instanceof i) && (this.a instanceof i) && (this.c instanceof i) && (this.d instanceof i)) ? 1 : null;
        if (obj == null || obj2 == null || obj3 == null) {
            return false;
        }
        return true;
    }

    public j e(float f) {
        b bVar = new b(this);
        bVar.e = new a(f);
        bVar.f = new a(f);
        bVar.g = new a(f);
        bVar.h = new a(f);
        return bVar.a();
    }

    public j() {
        this.a = new i();
        this.b = new i();
        this.c = new i();
        this.d = new i();
        this.e = new a(0.0f);
        this.f = new a(0.0f);
        this.g = new a(0.0f);
        this.h = new a(0.0f);
        this.i = new f();
        this.j = new f();
        this.k = new f();
        this.l = new f();
    }
}
